<!DOCTYPE HTML>
<html lang="zh">
<head>
<title>Thymeleaf 教程 - Thymeleaf Tutorial | Docs4dev</title>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="Thymeleaf 是一个适用于 Web 和独立环境的现代服务器端 Java 模板引擎。">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="HandheldFriendly" content="true">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta property="og:type" content="website">
<meta property="og:title" content="Thymeleaf 教程 - Thymeleaf Tutorial">
<meta property="og:url" content="https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/">
<meta property="og:site_name" content="Docs4dev">
<meta property="og:locale" content="zh_CN">
<meta name="twitter:card" content="Thymeleaf 是一个适用于 Web 和独立环境的现代服务器端 Java 模板引擎。">
<meta name="generator" content="Docs4dev template engine">
<link rel="stylesheet" href="static/css/app.min.css">
<link rel="shortcut icon" href="https://www.docs4dev.com/static/images/favicon.ico" type="image/x-icon">
<script async="" src="static/js/js.js"></script>
<script async="" src="static/js/adsbygoogle.js" crossorigin="anonymous"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
      dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'UA-129571937-1');
  </script>
<link rel="amphtml" href="https://www.docs4dev.com/amp/docs/zh/thymeleaf/3.0/reference/index.html">

<script type="application/ld+json">{"name":null,"headline":"Thymeleaf 教程-Thymeleaf Tutorial","inLanguage":"zh-CN","version":"3.0","image":"/static/icon/icon-thymeleaf.png","datePublished":"2021-05-20T12:51:01Z","dateCreated":"2021-05-20T12:51:01Z","dateModified":"2021-07-03T12:24:36Z","@context":"https://schema.org/","@type":"APIReference","abstract":"Thymeleaf 是一个适用于 Web 和独立环境的现代服务器端 Java 模板引擎。"}</script>
</head>
<body>
<div class="book with-summary">
<div class="book-summary">
<div class="logo">
<a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference');" style="color: inherit;">
<img src="static/picture/icon-thymeleaf.png" style="width: 48px; height: 48px;" alt="Logo">
</a>
<b style="color: inherit; margin-left: 8px;">Thymeleaf 教程</b>
</div>
<div class="item">
<div>
<label for="version">版本</label>
<select id="version" onchange="onVersionChange(this)">
<option value="3.0" selected="selected">3.0</option>
</select>
</div>
<div style="margin-top: 8px;">
<label for="language">语言</label>
<select id="language" onchange="onLangChange(this)" value="zh">
<option value="en">English</option>
<option value="zh" selected="selected">中文</option>
</select>
</div>

</div>
<div class="item menus">
<a title="Table of Contents" style="margin-right: 8px;" href="#">
<i class="fa fa-chevron-left"></i>
<span style="margin-left: 2px;">返回目录</span>
</a>
</div>
<nav role="navigation" id="navigation">
<ul class="summary">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#introducing-thymeleaf');" title="1 Thymeleaf 简介"> 1 Thymeleaf 简介 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#what-is-thymeleaf');" title="1.1 什么是 Thymeleaf？"> 1.1 什么是 Thymeleaf？ </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#what-kind-of-templates-can-thymeleaf-process');" title="1.2 Thymeleaf 可以处理哪种模板？"> 1.2 Thymeleaf 可以处理哪种模板？ </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#dialects-the-standard-dialect');" title="1.3 方言：标准方言"> 1.3 方言：标准方言 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-good-thymes-virtual-grocery');" title="2 The Good Thymes 虚拟杂货店"> 2 The Good Thymes 虚拟杂货店 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#a-website-for-a-grocery');" title="2.1 杂货店的网站"> 2.1 杂货店的网站 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#creating-and-configuring-the-template-engine');" title="2.2 创建和配置模板引擎"> 2.2 创建和配置模板引擎 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#using-texts');" title="3 使用 Literals"> 3 使用 Literals </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#a-multi-language-welcome');" title="3.1 多语言欢迎"> 3.1 多语言欢迎 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#more-on-texts-and-variables');" title="3.2 有关文本和变量的更多信息"> 3.2 有关文本和变量的更多信息 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#standard-expression-syntax');" title="4 标准表达语法"> 4 标准表达语法 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#messages');" title="4.1 Messages"> 4.1 Messages </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#variables');" title="4.2 Variables"> 4.2 Variables </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#expressions-on-selections-asterisk-syntax');" title="4.3 选择表达式(星号语法)"> 4.3 选择表达式(星号语法) </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#link-urls');" title="4.4 链接网址"> 4.4 链接网址 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#fragments');" title="4.5 Fragments"> 4.5 Fragments </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#literals');" title="4.6 Literals"> 4.6 Literals </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appending-texts');" title="4.7 附加 Literals"> 4.7 附加 Literals </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#literal-substitutions');" title="4.8 Literals 替代"> 4.8 Literals 替代 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#arithmetic-operations');" title="4.9 算术运算"> 4.9 算术运算 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#comparators-and-equality');" title="4.10 比较器和equal"> 4.10 比较器和equal </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conditional-expressions');" title="4.11 条件表达式"> 4.11 条件表达式 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#default-expressions-elvis-operator');" title="4.12 默认表达式(Elvis 运算符)"> 4.12 默认表达式(Elvis 运算符) </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-no-operation-token');" title="4.13 The No-Operation token"> 4.13 The No-Operation token </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#data-conversion-formatting');" title="4.14 数据转换/格式化"> 4.14 数据转换/格式化 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#preprocessing');" title="4.15 Preprocessing"> 4.15 Preprocessing </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-attribute-values');" title="5 设置属性值"> 5 设置属性值 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-the-value-of-any-attribute');" title="5.1 设置任何属性的值"> 5.1 设置任何属性的值 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-value-to-specific-attributes');" title="5.2 将值设置为特定属性"> 5.2 将值设置为特定属性 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-more-than-one-value-at-a-time');" title="5.3 一次设置多个值"> 5.3 一次设置多个值 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appending-and-prepending');" title="5.4 追加和前置"> 5.4 追加和前置 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#fixed-value-boolean-attributes');" title="5.5 固定值布尔属性"> 5.5 固定值布尔属性 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-the-value-of-any-attribute-default-attribute-processor');" title="5.6 设置任何属性的值(默认属性处理器)"> 5.6 设置任何属性的值(默认属性处理器) </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#support-for-html5-friendly-attribute-and-element-names');" title="5.7 支持 HTML5 友好的属性和元素名称"> 5.7 支持 HTML5 友好的属性和元素名称 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#iteration');" title="6 Iteration"> 6 Iteration </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#iteration-basics');" title="6.1 迭代基础"> 6.1 迭代基础 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#keeping-iteration-status');" title="6.2 保持迭代状态"> 6.2 保持迭代状态 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#optimizing-through-lazy-retrieval-of-data');" title="6.3 通过延迟检索数据进行优化"> 6.3 通过延迟检索数据进行优化 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conditional-evaluation');" title="7 条件评估"> 7 条件评估 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#simple-conditionals-if-and-unless');" title="7.1 简单条件：“if” 和 “unless”"> 7.1 简单条件：“if” 和 “unless” </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#switch-statements');" title="7.2 switch 语句"> 7.2 switch 语句 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-layout');" title="8 模板布局"> 8 模板布局 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#including-template-fragments');" title="8.1 包括模板片段"> 8.1 包括模板片段 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#parameterizable-fragment-signatures');" title="8.2 可参数化的片段签名"> 8.2 可参数化的片段签名 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#flexible-layouts-beyond-mere-fragment-insertion');" title="8.3 灵活的布局：不仅仅是插入片段"> 8.3 灵活的布局：不仅仅是插入片段 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#removing-template-fragments');" title="8.4 删除模板片段"> 8.4 删除模板片段 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#layout-inheritance');" title="8.5 版式继承"> 8.5 版式继承 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#local-variables');" title="9 局部变量"> 9 局部变量 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#attribute-precedence');" title="10 属性优先级"> 10 属性优先级 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#comments-and-blocks');" title="11 Comments 和块"> 11 Comments 和块 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#standard-htmlxml-comments');" title="11.1. 标准 HTML/XMLComments"> 11.1. 标准 HTML/XMLComments </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#thymeleaf-parser-level-comment-blocks');" title="11.2. Thymeleaf 解析器级 Comments 块"> 11.2. Thymeleaf 解析器级 Comments 块 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#thymeleaf-prototype-only-comment-blocks');" title="11.3. Thymeleaf 仅原型 Comments 块"> 11.3. Thymeleaf 仅原型 Comments 块 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#synthetic-thblock-tag');" title="11.4. 合成 th：block 标签"> 11.4. 合成 th：block 标签 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#inlining');" title="12 Inlining"> 12 Inlining </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#expression-inlining');" title="12.1 表达式内联"> 12.1 表达式内联 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#text-inlining');" title="12.2 内联 Literals"> 12.2 内联 Literals </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#javascript-inlining');" title="12.3 JavaScript 内联"> 12.3 JavaScript 内联 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#css-inlining');" title="12.4 CSS 内联"> 12.4 CSS 内联 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-template-modes');" title="13 文本模板模式"> 13 文本模板模式 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-syntax');" title="13.1 Literals 语法"> 13.1 Literals 语法 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#extensibility');" title="13.2 Extensibility"> 13.2 Extensibility </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-prototype-only-comment-blocks-adding-code');" title="13.3 纯文本原型 Comments 块：添加代码"> 13.3 纯文本原型 Comments 块：添加代码 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-parser-level-comment-blocks-removing-code');" title="13.4 解析器级别的文本 Comments 块：删除代码"> 13.4 解析器级别的文本 Comments 块：删除代码 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#natural-javascript-and-css-templates');" title="13.5 自然的 JavaScript 和 CSS 模板"> 13.5 自然的 JavaScript 和 CSS 模板 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#some-more-pages-for-our-grocery');" title="14 我们杂货店的其他页面"> 14 我们杂货店的其他页面 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#order-list');" title="14.1 订单清单"> 14.1 订单清单 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#order-details');" title="14.2 订单详细信息"> 14.2 订单详细信息 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#more-on-configuration');" title="15 有关配置的更多信息"> 15 有关配置的更多信息 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-resolvers');" title="15.1 模板解析器"> 15.1 模板解析器 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#message-resolvers');" title="15.2 邮件解析器"> 15.2 邮件解析器 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conversion-services');" title="15.3 转换服务"> 15.3 转换服务 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#logging');" title="15.4 Logging"> 15.4 Logging </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-cache');" title="16 模板缓存"> 16 模板缓存 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#decoupled-template-logic');" title="17 解耦模板逻辑"> 17 解耦模板逻辑 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#decoupled-logic-the-concept');" title="17.1 解耦逻辑：概念"> 17.1 解耦逻辑：概念 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#configuring-decoupled-templates');" title="17.2 配置解耦的模板"> 17.2 配置解耦的模板 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-thref-attribute');" title="17.3 th：ref 属性"> 17.3 th：ref 属性 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#performance-impact-of-decoupled-templates');" title="17.4 解耦的模板对性能的影响"> 17.4 解耦的模板对性能的影响 </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#resolution-of-decoupled-logic');" title="17.5 解耦逻辑的解析"> 17.5 解耦逻辑的解析 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-a-expression-basic-objects');" title="18 附录 A：表达式基本对象"> 18 附录 A：表达式基本对象 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#base-objects');" title="Base objects"> Base objects </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#web-context-namespaces-for-requestsession-attributes-etc.');" title="请求/会话属性等的 Web 上下文名称空间."> 请求/会话属性等的 Web 上下文名称空间. </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#web-context-objects');" title="Web 上下文对象"> Web 上下文对象 </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-b-expression-utility-objects');" title="19 附录 B：表达式 Util 对象"> 19 附录 B：表达式 Util 对象 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#execution-info');" title="Execution Info"> Execution Info </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#messages-1');" title="Messages"> Messages </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#urisurls');" title="URIs/URLs"> URIs/URLs </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conversions');" title="Conversions"> Conversions </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#dates');" title="Dates"> Dates </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#calendars');" title="Calendars"> Calendars </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#numbers');" title="Numbers"> Numbers </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#strings');" title="Strings"> Strings </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#objects');" title="Objects"> Objects </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#booleans');" title="Booleans"> Booleans </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#arrays');" title="Arrays"> Arrays </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#lists');" title="Lists"> Lists </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#sets');" title="Sets"> Sets </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#maps');" title="Maps"> Maps </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#aggregates');" title="Aggregates"> Aggregates </a> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#ids');" title="IDs"> IDs </a> </li>
</ul> </li>
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-c-markup-selector-syntax');" title="20 附录 C：标记 selectors 语法"> 20 附录 C：标记 selectors 语法 </a>
<ul class="articles">
<li class="chapter"> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#multivalued-class-matching');" title="多值类匹配"> 多值类匹配 </a> </li>
</ul> </li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<header class="book-header">
<div class="dropdown pull-right js-toolbar-action">
<a class="btn toggle-dropdown" aria-label="Language" href="#">
<i class="fa fa-globe"></i>
</a>
<div class="dropdown-menu dropdown-left">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<button class="button size-1" onclick="changeLang('zh_CN')">中文</button>
</div>
<div class="buttons">
<button class="button size-1" onclick="changeLang('en_US')">English</button>
</div>
</div>
</div>
<a class="btn pull-right js-toolbar-action non-mobile" aria-label="Sign up" href="register.html">
<i class="fa fa-sign-in"></i> <span>注册</span>
</a>
<a class="btn pull-right js-toolbar-action non-mobile" aria-label="Sign in" href="register.html">
<i class="fa fa-sign-in"></i>
<span>登录</span>
</a>
<a class="btn pull-left js-toolbar-action btn-summary" href="#"><i class="fa fa-align-justify"></i></a>
<div class="dropdown pull-left font-settings js-toolbar-action">
<a class="btn toggle-dropdown" aria-label="Font Settings" href="#">
<i class="fa fa-font"></i>
</a>
<div class="dropdown-menu dropdown-right">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<button class="button size-2 font-reduce">A</button>
<button class="button size-2 font-enlarge">A</button>
</div>
<div class="buttons">
<button class="button size-2 family-serif">Serif</button>
<button class="button size-2 family-sans">Sans</button>
</div>
<div class="buttons">
<button class="button size-3 theme-white">White</button>
<button class="button size-3 theme-sepia">Sepia</button>
<button class="button size-3 theme-night">Night</button>
</div>
</div>
</div>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Home" href="zh.html">
<i class="fa fa-home"></i> <span>首页</span>
</a>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Guide" href="javascript:window.open('https://www.javadoc.org/');">
<i class="fa fa-book"></i> <span>API Docs</span>
</a>
<a class="btn pull-left js-toolbar-action non-mobile" aria-label="Tools" href="index1.html">
<i class="fa fa-gears"></i> <span>工具</span>
</a>
<div class="dropdown pull-left js-toolbar-action mobile">
<a class="btn toggle-dropdown" aria-label="Language" href="#">
<i class="fa fa-chevron-down"></i>
</a>
<div class="dropdown-menu dropdown-right">
<div class="dropdown-caret"><span class="caret-outer"></span><span class="caret-inner"></span></div>
<div class="buttons">
<a class="button size-1" aria-label="Home" href="zh.html">
<i class="fa fa-home"></i> <span>首页</span>
</a>
</div>
<div class="buttons">
<a class="button size-1" aria-label="Guide" href="javascript:window.open('https://www.javadoc.org/');">
<i class="fa fa-book"></i> <span>API Docs</span>
</a>
</div>
<div class="buttons">
<a class="button size-1" aria-label="Tools" href="index1.html">
<i class="fa fa-gears"></i> <span>工具</span>
</a>
</div>
</div>
</div>
<div id="autocomplete" class="pull-right"></div>
<span id="toolbar-title"></span>
</header>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal markdown-section">
<div id="content">
<h1>Thymeleaf Tutorial</h1>
<div><ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-6108808167664152" data-ad-slot="6964403648"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
<div><div class="divider">
<span class="divider-inner-text">Table of Contents</span>
</div>
<ul class="toc">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#introducing-thymeleaf');" title="1 Thymeleaf 简介"> 1 Thymeleaf 简介 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#what-is-thymeleaf');" title="1.1 什么是 Thymeleaf？"> 1.1 什么是 Thymeleaf？ </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#what-kind-of-templates-can-thymeleaf-process');" title="1.2 Thymeleaf 可以处理哪种模板？"> 1.2 Thymeleaf 可以处理哪种模板？ </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#dialects-the-standard-dialect');" title="1.3 方言：标准方言"> 1.3 方言：标准方言 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-good-thymes-virtual-grocery');" title="2 The Good Thymes 虚拟杂货店"> 2 The Good Thymes 虚拟杂货店 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#a-website-for-a-grocery');" title="2.1 杂货店的网站"> 2.1 杂货店的网站 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#creating-and-configuring-the-template-engine');" title="2.2 创建和配置模板引擎"> 2.2 创建和配置模板引擎 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#using-texts');" title="3 使用 Literals"> 3 使用 Literals </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#a-multi-language-welcome');" title="3.1 多语言欢迎"> 3.1 多语言欢迎 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#more-on-texts-and-variables');" title="3.2 有关文本和变量的更多信息"> 3.2 有关文本和变量的更多信息 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#standard-expression-syntax');" title="4 标准表达语法"> 4 标准表达语法 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#messages');" title="4.1 Messages"> 4.1 Messages </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#variables');" title="4.2 Variables"> 4.2 Variables </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#expressions-on-selections-asterisk-syntax');" title="4.3 选择表达式(星号语法)"> 4.3 选择表达式(星号语法) </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#link-urls');" title="4.4 链接网址"> 4.4 链接网址 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#fragments');" title="4.5 Fragments"> 4.5 Fragments </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#literals');" title="4.6 Literals"> 4.6 Literals </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appending-texts');" title="4.7 附加 Literals"> 4.7 附加 Literals </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#literal-substitutions');" title="4.8 Literals 替代"> 4.8 Literals 替代 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#arithmetic-operations');" title="4.9 算术运算"> 4.9 算术运算 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#comparators-and-equality');" title="4.10 比较器和equal"> 4.10 比较器和equal </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conditional-expressions');" title="4.11 条件表达式"> 4.11 条件表达式 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#default-expressions-elvis-operator');" title="4.12 默认表达式(Elvis 运算符)"> 4.12 默认表达式(Elvis 运算符) </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-no-operation-token');" title="4.13 The No-Operation token"> 4.13 The No-Operation token </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#data-conversion-formatting');" title="4.14 数据转换/格式化"> 4.14 数据转换/格式化 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#preprocessing');" title="4.15 Preprocessing"> 4.15 Preprocessing </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-attribute-values');" title="5 设置属性值"> 5 设置属性值 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-the-value-of-any-attribute');" title="5.1 设置任何属性的值"> 5.1 设置任何属性的值 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-value-to-specific-attributes');" title="5.2 将值设置为特定属性"> 5.2 将值设置为特定属性 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-more-than-one-value-at-a-time');" title="5.3 一次设置多个值"> 5.3 一次设置多个值 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appending-and-prepending');" title="5.4 追加和前置"> 5.4 追加和前置 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#fixed-value-boolean-attributes');" title="5.5 固定值布尔属性"> 5.5 固定值布尔属性 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#setting-the-value-of-any-attribute-default-attribute-processor');" title="5.6 设置任何属性的值(默认属性处理器)"> 5.6 设置任何属性的值(默认属性处理器) </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#support-for-html5-friendly-attribute-and-element-names');" title="5.7 支持 HTML5 友好的属性和元素名称"> 5.7 支持 HTML5 友好的属性和元素名称 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#iteration');" title="6 Iteration"> 6 Iteration </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#iteration-basics');" title="6.1 迭代基础"> 6.1 迭代基础 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#keeping-iteration-status');" title="6.2 保持迭代状态"> 6.2 保持迭代状态 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#optimizing-through-lazy-retrieval-of-data');" title="6.3 通过延迟检索数据进行优化"> 6.3 通过延迟检索数据进行优化 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conditional-evaluation');" title="7 条件评估"> 7 条件评估 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#simple-conditionals-if-and-unless');" title="7.1 简单条件：“if” 和 “unless”"> 7.1 简单条件：“if” 和 “unless” </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#switch-statements');" title="7.2 switch 语句"> 7.2 switch 语句 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-layout');" title="8 模板布局"> 8 模板布局 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#including-template-fragments');" title="8.1 包括模板片段"> 8.1 包括模板片段 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#parameterizable-fragment-signatures');" title="8.2 可参数化的片段签名"> 8.2 可参数化的片段签名 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#flexible-layouts-beyond-mere-fragment-insertion');" title="8.3 灵活的布局：不仅仅是插入片段"> 8.3 灵活的布局：不仅仅是插入片段 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#removing-template-fragments');" title="8.4 删除模板片段"> 8.4 删除模板片段 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#layout-inheritance');" title="8.5 版式继承"> 8.5 版式继承 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#local-variables');" title="9 局部变量"> 9 局部变量 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#attribute-precedence');" title="10 属性优先级"> 10 属性优先级 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#comments-and-blocks');" title="11 Comments 和块"> 11 Comments 和块 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#standard-htmlxml-comments');" title="11.1. 标准 HTML/XMLComments"> 11.1. 标准 HTML/XMLComments </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#thymeleaf-parser-level-comment-blocks');" title="11.2. Thymeleaf 解析器级 Comments 块"> 11.2. Thymeleaf 解析器级 Comments 块 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#thymeleaf-prototype-only-comment-blocks');" title="11.3. Thymeleaf 仅原型 Comments 块"> 11.3. Thymeleaf 仅原型 Comments 块 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#synthetic-thblock-tag');" title="11.4. 合成 th：block 标签"> 11.4. 合成 th：block 标签 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#inlining');" title="12 Inlining"> 12 Inlining </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#expression-inlining');" title="12.1 表达式内联"> 12.1 表达式内联 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#text-inlining');" title="12.2 内联 Literals"> 12.2 内联 Literals </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#javascript-inlining');" title="12.3 JavaScript 内联"> 12.3 JavaScript 内联 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#css-inlining');" title="12.4 CSS 内联"> 12.4 CSS 内联 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-template-modes');" title="13 文本模板模式"> 13 文本模板模式 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-syntax');" title="13.1 Literals 语法"> 13.1 Literals 语法 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#extensibility');" title="13.2 Extensibility"> 13.2 Extensibility </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-prototype-only-comment-blocks-adding-code');" title="13.3 纯文本原型 Comments 块：添加代码"> 13.3 纯文本原型 Comments 块：添加代码 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#textual-parser-level-comment-blocks-removing-code');" title="13.4 解析器级别的文本 Comments 块：删除代码"> 13.4 解析器级别的文本 Comments 块：删除代码 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#natural-javascript-and-css-templates');" title="13.5 自然的 JavaScript 和 CSS 模板"> 13.5 自然的 JavaScript 和 CSS 模板 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#some-more-pages-for-our-grocery');" title="14 我们杂货店的其他页面"> 14 我们杂货店的其他页面 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#order-list');" title="14.1 订单清单"> 14.1 订单清单 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#order-details');" title="14.2 订单详细信息"> 14.2 订单详细信息 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#more-on-configuration');" title="15 有关配置的更多信息"> 15 有关配置的更多信息 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-resolvers');" title="15.1 模板解析器"> 15.1 模板解析器 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#message-resolvers');" title="15.2 邮件解析器"> 15.2 邮件解析器 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conversion-services');" title="15.3 转换服务"> 15.3 转换服务 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#logging');" title="15.4 Logging"> 15.4 Logging </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#template-cache');" title="16 模板缓存"> 16 模板缓存 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#decoupled-template-logic');" title="17 解耦模板逻辑"> 17 解耦模板逻辑 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#decoupled-logic-the-concept');" title="17.1 解耦逻辑：概念"> 17.1 解耦逻辑：概念 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#configuring-decoupled-templates');" title="17.2 配置解耦的模板"> 17.2 配置解耦的模板 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#the-thref-attribute');" title="17.3 th：ref 属性"> 17.3 th：ref 属性 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#performance-impact-of-decoupled-templates');" title="17.4 解耦的模板对性能的影响"> 17.4 解耦的模板对性能的影响 </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#resolution-of-decoupled-logic');" title="17.5 解耦逻辑的解析"> 17.5 解耦逻辑的解析 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-a-expression-basic-objects');" title="18 附录 A：表达式基本对象"> 18 附录 A：表达式基本对象 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#base-objects');" title="Base objects"> Base objects </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#web-context-namespaces-for-requestsession-attributes-etc.');" title="请求/会话属性等的 Web 上下文名称空间."> 请求/会话属性等的 Web 上下文名称空间. </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#web-context-objects');" title="Web 上下文对象"> Web 上下文对象 </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-b-expression-utility-objects');" title="19 附录 B：表达式 Util 对象"> 19 附录 B：表达式 Util 对象 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#execution-info');" title="Execution Info"> Execution Info </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#messages-1');" title="Messages"> Messages </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#urisurls');" title="URIs/URLs"> URIs/URLs </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#conversions');" title="Conversions"> Conversions </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#dates');" title="Dates"> Dates </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#calendars');" title="Calendars"> Calendars </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#numbers');" title="Numbers"> Numbers </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#strings');" title="Strings"> Strings </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#objects');" title="Objects"> Objects </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#booleans');" title="Booleans"> Booleans </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#arrays');" title="Arrays"> Arrays </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#lists');" title="Lists"> Lists </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#sets');" title="Sets"> Sets </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#maps');" title="Maps"> Maps </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#aggregates');" title="Aggregates"> Aggregates </a> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#ids');" title="IDs"> IDs </a> </li>
</ul> </li>
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#appendix-c-markup-selector-syntax');" title="20 附录 C：标记 selectors 语法"> 20 附录 C：标记 selectors 语法 </a>
<ul class="articles">
<li> <a href="javascript:window.open('https://www.docs4dev.com/docs/zh/thymeleaf/3.0/reference/using_thymeleaf.html#multivalued-class-matching');" title="多值类匹配"> 多值类匹配 </a> </li>
</ul> </li>
</ul></div>
</div>
</section>
<div class="right-sidebar">
<div class="affix"><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-6108808167664152" data-ad-slot="3102929424" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
</div>
</div>
<div class="ft">
<a href="#toolbar-title" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a>
<footer class="footer">
<div class="footer__container--normal">
<img alt="扫码关注公众号" title="扫码关注公众号" src="static/picture/qr-code.png" width="170" height="170">
<div class="footer__description--normal">
<p class="paragraph footer__author--normal">Docs4dev<sup class="super">&#xAE;</sup>
</p>
<p class="paragraph footer__quote&#45;&#45;normal">
如果你在使用过程中遇到任何问题，可以在 <a href="javascript:window.open('https://github.com/docs4dev/docs4dev-issues');" target="_blank" rel="noopener noreferrer">这里<i class="fa fa-external-link"></i></a> 提issue。
</p>
<div class="footer__main--normal">
<p class="paragraph footer__main__paragraph--normal copyright" style="color: #666 !important;">
<a href="javascript:window.open('https://beian.miit.gov.cn/');">
蜀ICP备14021783号-6
</a>
</p>
<p class="paragraph footer__main__paragraph--normal copyright" style="color: #666 !important;">
Copyright &#xA9; Docs4dev all
right reserved, powered by <a href="index2.html" target="_blank">Docs4dev</a></p>
</div>
</div>
</div>
<div class="box__issues">
</div>
</footer>
</div>
</div>
</div>
</div>
</div>
<script>
  var hasToc = true;
  /*  var downloadable = /!*false*!/ false;
    var editable = /!*false*!/ false;
    var code = /!*"thymeleaf"*!/ false;
    var version = /!*"3.0"*!/ false;
    var type = /!*"reference"*!/ false;
    var lang = /!*"zh"*!/ 'en';
    //edit link
    require(["gitbook", "jQuery"], function (gitbook, $) {
      gitbook.events.bind('start', function (e, config) {
        // Add edit toolbar to left
        var chapterId = /!*24802*!/ 0;
        if (downloadable) {
          gitbook.toolbar.createButton({
            icon: 'fa fa-download',
            text: '下载',
            onClick: function () {
              window.open('/download?code=' + code + '&version=' + version + '&type=' + type + '&lang=' + lang);
            }
          });
        }
        if (editable) {
          gitbook.toolbar.createButton({
            icon: 'fa fa-edit',
            text: '编辑此页',
            onClick: function () {
              window.open('/docs/edit?chapterId=' + chapterId + '&lang=' + lang);
            }
          });
        }
      });
    });*/
</script>
<script>
    var code = "thymeleaf";
    var lang = "zh";
  </script>

<script src="static/js/autocomplete-js.js"></script>
<script src="static/js/app.min.js"></script>
<script src="static/js/search.min.js"></script>
</body>
</html>
